<div id="slideshow<?php echo $module; ?>" class="flexslider">
  <ul class="slides">
  <?php foreach ($banners as $banner) { ?>
    <?php if ($banner['link']) { ?>
      <li><a href="<?php echo $banner['link']; ?>"><img src="<?php echo $banner['image']; ?>" alt="<?php echo $banner['title']; ?>" /></a></li>
      <?php } else { ?>
      <li><img src="<?php echo $banner['image']; ?>" alt="<?php echo $banner['title']; ?>" /></li>
    <?php } ?>
  <?php } ?>
  </ul>
</div>

  <script type="text/javascript">
    $(window).load(function(){
      $('.flexslider').flexslider({
        animation: "fade",
        prevText: "",
        nextText: "", 
        slideshowSpeed: 7000,
        animationSpeed: 1000,
      });
    });
  </script>